<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2024/11/28
  Time: 18:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
    <title>Title</title>
    <style>
        .errorMsg{
            color:red;
        }
    </style>
</head>
<body>
<h1>
    基于Spring标签库的 表单提交和 数据校验
</h1>

<form:form action="register3" id="registerForm" method="GET" modelAttribute="user" >
    <form:label path="username">用户名</form:label><form:input path="username"></form:input>  <form:errors path="username" cssClass="errorMsg"></form:errors> <br>
    <form:label path="password">密码</form:label><form:password path="password"></form:password>   <form:errors path="password" cssClass="errorMsg"></form:errors><br>
    <form:label path="userAge">年龄</form:label> <form:input path="userAge"></form:input>  <form:errors path="userAge" cssClass="errorMsg"></form:errors> <br>
<%--    <form:button >提交</form:button>--%>
    <input type="submit" value="注册">
</form:form>
</body>
</html>
